package inventory.daoImplementer;

import dbhandelling.Crude;
import dto.StockOut;
import inventory.daoInterface.MaterialMasterDao;
import inventory.daoInterface.StockInDao;
import inventory.daoInterface.StockOutDao;


public class StockOutImplementor extends Crude implements StockOutDao
{
	
	@Override
	public void add(StockOut stockOuts) throws Exception 
	{
		insert(stockOuts);
	}

	@Override
	public void update(StockOut stockOuts) throws Exception 
	{
		
	}

	@Override
	public void delete(StockOut stockOuts) throws Exception 
	{
		
	}

	@Override
	public StockOut retreive(String conditionField, String ConditionValue) throws Exception 
	{
		StockOut stockOuts=(StockOut) super.retreive("StockOut",conditionField, ConditionValue);
		return stockOuts;
	}

	@Override
	public StockOut[] retreiveArray(String conditionField, String conditionValue) throws Exception 
	{
		StockOut[] materialMasters;
		Object[] obj=super.retreiveArrayOnCondition("StockOut", conditionField, conditionValue);
		materialMasters=new StockOut[obj.length];
		
		for(int i=0;i<materialMasters.length;i++)
		{
			materialMasters[i]=(StockOut) obj[i];
		}
		
		return materialMasters;
	}

	@Override
	public StockOut[] retreiveAll() throws Exception 
	{
		StockOut[] materialMasters;
		
		Object[] obj=super.retreiveAll("StockOut");
		
		materialMasters=new StockOut[obj.length];
		
		for(int i=0;i<materialMasters.length;i++)
		{
			materialMasters[i]=(StockOut) obj[i];
		}
		
		return materialMasters;
	}

}
